//引入express
var express = require('express');
var app = express();
//进行配置
app.get('/',function(req,res){
	res.sendfile(__dirname + '/index.html')
});

app.get('/login',function(req,res){
	
	var username = req.query.username;
	var password = req.query.password;
	
	if(username == 'admin'&& password == '123456'){
		res.sendfile(__dirname + '/1.html')
	}else{
		res.sendfile(__dirname + '/2.html')
	}
});

//创建监听
var server = app.listen(8888,function(){
	console.log('服务器启动成功');
})
